# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Travis Willard <travisw@wmpub.ca>
# Contributor: Jaroslaw Swierczynski <swiergot@juvepoland.com>
# Contributor: Nicolai Lissner <nlissne@linux01.gwdg.de>

pkgname=dvdauthor
pkgver=0.7.2
pkgrel=11
pkgdesc='DVD authoring tools'
arch=('loong64' 'x86_64')
url='http://dvdauthor.sourceforge.net/'
license=('GPL2')
depends=('libdvdread' 'imagemagick' 'libxml2')
source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
        'dvdauthor-0.7.2-imagemagick7.patch')
sha256sums=('3020a92de9f78eb36f48b6f22d5a001c47107826634a785a62dfcd080f612eb7'
            '5c6a6c1cca2fdb2a0037507361980de7ed3bf6c603cb85e9ce273eaf0028dc00')

prepare() {
  cd $pkgname

  # Port to imagemagick 7
  # https://bugs.gentoo.org/610574#c2
  patch -Np1 -i ../dvdauthor-0.7.2-imagemagick7.patch

  # don't search for obsolete freetype-config
  sed -e 's|freetype-config|pkg-config freetype2|' -i configure.ac

  autoreconf -vi
}

build() {
  cd $pkgname
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
